<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <!-- <div id="btn" onclick="demo()">随便写句话</div> -->

    <input type="text" id="btn">

    <script>

    //    1. 绑定事件
   /*  document.getElementById("btn").onclick = function(){
        alert(1234567890);
    }
 */

    //2. 绑定事件
    // document.getElementById("btn").addEventListener("click",function(){
    //     alert(1234567890);
    // })

    // // 3. 行内绑定
    // function demo(){
    //     alert(1234567890);

    // }

    document.getElementById("btn").oninput = function(){
        console.log("12345678");
    }


        // 事件
        /* onclick
        onmousemove
        onmouseover
        onmouseout
        onmouseenter
        onmouseleave
        onmouseup
        onchange
        onblur
        onfocus
        onkeydown
        onkeyup
        onsubmit
        onreset */







    </script>
</body>
</html>